﻿var VmLogin = new Vue({
    el: "#divLogin",
    data: {
        recruitmentInfoList: [],
        recruitmentNewsList: [],
        educationalDynamicsList: [],
        noticeList: []
    },
    mounted: function () {
        this.getRecruitmentInfoList();
        this.getRecruitmentNewsList();
        this.getEducationalDynamicsList();
        this.getNoticelist();
    },
    methods: {
        getRecruitmentInfoList: function () {
            var that = this;
            $.getJSON("/Notice/GetNoticeListByPage", { pageSize: 5, pageIndex: 1, noticeType: 1 }, function (data) {
                that.recruitmentInfoList = data.list;
            });
        },
        getRecruitmentNewsList: function () {
            var that = this;
            $.getJSON("/Notice/GetNoticeListByPage", { pageSize: 5, pageIndex: 1, noticeType: 2 }, function (data) {
                that.recruitmentNewsList = data.list;
            });
        },
        getEducationalDynamicsList: function () {
            var that = this;
            $.getJSON("/Notice/GetNoticeListByPage", { pageSize: 5, pageIndex: 1, noticeType: 3 }, function (data) {
                that.educationalDynamicsList = data.list;
            });
        },
        getNoticelist: function () {
            var that = this;
            $.getJSON("/Notice/GetNoticeListByPage", { pageSize: 5, pageIndex: 1, noticeType: 4 }, function (data) {
                that.noticeList = data.list;
            });
        },
        goToExper: function (id) {
            location.href = "/Experiment/ExperimentDetails/" + id;
        }, 
        getNoticeUrl: function (id) {
            return "/Notice/Detail/" + id;
        },

        //列表属性转换
        formatDate: function (value) { 
            return value.split(" ")[0];
        },
        intoDetail: function (id) {
            location.href = "/Notice/Detail/" + id;
        }
    }
})